#pragma once
#include "sgobject.h"
#include <vector>
#include "graphics/GrVector.h"

class CSgPolygon : public CSgObject
{
public:
	CSgPolygon();
	virtual ~CSgPolygon();

	virtual void Render();

	//void AddVertex3d(double x, double y, double z);
	//void AddVertex3dv(double *p);
	//void AddVertices(double *a, double *b, double *c, double *d=NULL);
	//void AddTextureVertices(double *a, double *b, double *c);

	void AddVertex(const CGrVector &v) {m_vertices.push_back(v);}
    void AddNormal(const CGrVector &n) {m_normals.push_back(n);}
    void AddTexCoord(const CGrVector &t) {m_tvertices.push_back(t);}

protected:
	// A polygon is a vector of vertices
	std::vector<CGrVector> m_vertices;

	// Texture vertices
	std::vector<CGrVector> m_tvertices;

	// Normals (automatically computed)
	std::vector<CGrVector> m_normals;
};
